//
//  PlazaViewModel.swift
//  NDAi
//
//  Created by 丸子 on 2024/6/27.
//

import UIKit

class PlazaViewModel {
    var list:[PlazaListModel] = []
    let reloadDataSubject = PublishSubject<Void>()

    func getPlazaList() {
        NDProgressHUD.showLoading()
        RequestService.instance.presetData(dataType: 2) {[weak self] models in
            NDProgressHUD.hide()
            guard let self = self else { return }
            if let models = models, !models.isEmpty {
                self.list = models
                self.reloadDataSubject.onNext(())
            }
        } failureClosure: { error in
            NDProgressHUD.hide()
        }
    }

}
